<template>
	<view class="QS-P" ref="QS-P" :class="getClass" :style="getStyle">
		<slot></slot>
	</view>
</template>

<script>
	import nProps from './props.js';
	import QSComponentMixin from '../../mixins/QS-Components-Mixin.js';
	
	let props;
	try{
		props = require('@/QS-UI-CONFIG/components/QS-P/js/props.js');
	}catch(e){
		//TODO handle the exception
		props = {};
	}
	
	const QSComponentMixinRes = QSComponentMixin({ 
		componentType: 'QS-P',
		nodeName: '.QS-P'
	});
	export default {
		mixins: [QSComponentMixinRes.mixin],
		props: {
			// #ifdef MP-ALIPAY
			...QSComponentMixinRes.props,
			// #endif
			...nProps,
			...props
		},
		computed: {
			QS_nCompStyle() {
				const style = {
					height: this.getHeight,
					width: this.getWidth,
					// #ifndef APP-NVUE
					minHeight: this.getHeight,
					minWidth: this.getWidth,
					backgroundColor: this.backgroundColor,
					// #endif
					borderRadius: this.borderRadius
				};
				return style;
			},
			getHeight() {
				if(this.size) return this.size;
				return this.height;
			},
			getWidth() {
				if(this.size) return this.size;
				return this.width;
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>
